 */
public class Test {

    public static void main(String[] args) {
        int a = 20;
        if(a == 10);

        {
            System.out.println("bbb");
            System.out.println("ccc");
            System.out.println("aaa");
        }
    }

    public static void main12(String[] args) {
      /*  int a = 1;
        int b = 2;
        //比较的结果 是true  或者 false
        System.out.println(a == b);
        System.out.println(a < b);
        System.out.println(a > b);
        System.out.println(a >= b);//a > b || a == b
        System.out.println(a <= b);//a < b || a == b
        System.out.println(a != b);
*/
        /*System.out.println(true && false);
        System.out.println(false && true);
        System.out.println(false && false);
        System.out.println(true && true);
*/

        /*System.out.println(true || false);
        System.out.println(false || true);
        System.out.println(false || false);
        System.out.println(true || true);

        int a = 1;
        int b = 2;

        System.out.println(!(a == b));
        System.out.println(!false);
        //System.out.println(!a);
*/


        //System.out.println(10 > 20 & 10 / 0 == 0); // 打印 false


        //System.out.println(10 < 20 | 10 / 0 == 0); // 打印 true

         /*int a = -1;
       int b = ~a;
        System.out.println(b);

        System.out.println(a >> 1);
        System.out.println(a >>> 1);*/



        /*int a = 10;
        int b = 20;
        //        布尔表达式 ? a : b;
        int max = a > b ? a : b;
        */

        //boolean flg = true == true ? true == false ? true : false : true;
        boolean flg = true == true ? ((true == false) ? true : false) : true;
        System.out.println(flg);

       /*int i = 10;
        int a = (i++,++i);*/
    }

    public static void main11(String[] args) {
        int a = 10;
        int b = a++;
        System.out.println(a);//a.sout
        System.out.println(b);
    }

    public static void main10(String[] args) {
        //System.out.println(5/2);
        //System.out.println(5.0/2);
        //System.out.println(5.0/0);

        /*System.out.println(9%2);//1
        System.out.println(9%-2);//1
        System.out.println(-9%2);//-1
        System.out.println(-9%-2);//-1
*/

        System.out.println(11.5%2);
        System.out.println(11.5%2);

        double d = 12.5;
        int c = 20;
        //c = c+d;
        c += d;
        System.out.println(c);
    }

    public static void main9(String[] args) {
        String str = "123";
        int a = Integer.parseInt(str);//str必须是一个合法的字符串数字
        System.out.println(a+1);
    }

    public static void main8(String[] args) {
        int num = 10;
        // 方法1
        String str1 = num + "";
        System.out.println(str1);
        // 方法2
        String str2 = String.valueOf(num);
        System.out.println(str2);
    }

    public static void main7(String[] args) {
        //C语言 有没有字符串类型？
        String str = "hello";
        String str2 = "world";
        //+意为拼接
        String str3 = str + str2;
        System.out.println(str3);
        int a = 10;
        int b = 20;
        //a = 10 b = 20
        System.out.println("a = " + a +" b = "+b);
        System.out.println("a+b = "+(a+b)); // 整体都是以字符串来看待的
        System.out.println(a + b + "<= a+b");
        //char *p = "hello";
    }

    public static void main6(String[] args) {
        /*int a = 10;
        long b = 20;
        int c = (int)(a + b);
        long d = a + b;*/


        byte a = 10;
        byte b = 20;
        //所有小于4个字节的 变量  都会提升为4个字节
        byte c = (byte)(a + b);
        System.out.println(c);
    }

    public static void main5(String[] args) {
        /*
        JVM 没有明确他的大小
        不能和其他类型进行转化
         */
        boolean flg = true;
        System.out.println(flg);


        int a = 10;//4
        long b = 100L;//8

        //b = a; // 可以通过编译


        a = (int)b; // 编译失败

        byte bb = (byte)128;
        System.out.println(bb);

    }

    public static void main4(String[] args) {
        /*
        2个字节
        unicode字符集 -》阿拉伯 汉字 ....
         */
        char ch = 'a';
        char ch2 = 97;
        System.out.println(ch2);
    }

    public static void main3(String[] args) {
        // 12.5 -》是一个double类型的数据   8个字节     4个字节
        float f = 12.5f;
        System.out.println(f);
        System.out.printf("%f\n",f);
    }

    public static void main2(String[] args) {
        //8个字节
        double d = 12.5;
        System.out.println(d);

        double a = 1.0;
        double b = 2.0;
        System.out.println(a / b);

        double num = 1.1;
        System.out.println(num * num);
    }

    public static void main1(String[] args) {
        //BigDecimal
        /*
        8个字节
        64个bit  1符号位    63个数值位
        -2^63   到   2^63 -1
         */
        long a = 10L;//说明 当前这个10 是一个long类型的数据
        System.out.println(a);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);

        /*
        2个字节
        -2^15   到   2^15 -1
         */
        short s = 10;
        System.out.println(s);
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);


        /*
        1个字节
        -128  127
        字节类型
         */
        byte b = 127;
        System.out.println(b);
        System.out.println(Byte.MIN_VALUE);
        System.out.println(Byte.MAX_VALUE);
    }
}
